﻿using System;

namespace InternetSpiderLib.Scenes.Filters
{
    /// <summary>
    /// 匿名的过滤器
    /// </summary>
    public class AnonymousSceneFilter : ISceneFilter
    {
        protected Func<DataBox, bool> Func { get; set; }

        public AnonymousSceneFilter(Func<DataBox, bool> func)
        {
            Func = func;
        }

        public bool Filter(DataBox data)
        {
            return Func?.Invoke(data) ?? false;
        }
    }
}
